arrays = [
    [9, 5, 3, 1, 2, 4, 6, 8, 7],
    [78, 56, 69, 22, 90, 66, 32, 56, 11, 29, 75, 33, 39, 65, 48, 61, 99, 84, 59, 17],
]

def insert_sort(array):
    print(f"origin: {array}")
    length = len(array)
    for i in range(1, length):
        for j in range(i, 0, -1):
            if array[j] < array[j - 1]:
                array[j], array[j - 1] = array[j - 1], array[j]
            else:
                break
        print(f"--> {array}")
    return array

for array in arrays:
    print("排序结果:",insert_sort(array))
